package com.mjfeed.controller.m;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.mjfeed.controller.BaseController;
import com.mjfeed.service.CartItemService;
import com.mjfeed.service.CartService;
import com.mjfeed.service.MemberService;
import com.mjfeed.service.ProductService;

/**
 * @description 
 * @author zhaominglei
 * @date 2014年12月13日
 */
@Controller("mCartController")
@RequestMapping("/m")
public class CartController extends BaseController {
	@Resource(name="memberService")
	private MemberService memberService;
	@Resource(name="productService")
	private ProductService productService;
	@Resource(name="cartService")
	private CartService cartService;
	@Resource(name="cartItemService")
	private CartItemService cartItemService;
	
	/**
	 * 列表
	 */
	@RequestMapping(value = "/cart", method = RequestMethod.GET)
	public String list(HttpServletRequest request, HttpServletResponse response, Model model) {
		request.setAttribute("cart", cartService.getCurrent());
		return "m/cart";
	}
}
